<%@page import="java.util.LinkedList"%>
<%
            bean.DataBaseConnection conn = new bean.DataBaseConnection ();
            LinkedList listMobil= null;
%>

<html>
    <head>
        <title>FORMULIR | ROUTER RENT CAR</title>
        

        
        <style>
      
            #main{
                font-weight: bold;
                padding-left:0px;
                padding-right:0px;
                margin-top: 30px;
                margin-left:150px;
                margin-right:75px;
                margin-bottom:0px;
            }

            #menuhor{
                list-style-type: disc;
                margin: 0;
                padding: 0;

                float: left;
            }
            #menuhor li {
                margin: 0;
                padding: 0;
                float: left;

            }
            #menuhor a {
                float: none;
                width: 180px;
                text-align: center;
                color: #FFF;
                text-decoration: none;
                padding: 2px;
                line-height: 2;
                margin-bottom: 3px;
            }
            #menuhor a:hover{
                background: brown;
            }            

            #iklan{
                list-style-type: none;
                margin: 0;
                padding: 0;
                width: 180px;
                background-color: red;
                float: left;
            }


        </style>
    </head>

    <body background="images/space.jpg">
        <form action="customer" method="post">
        <div id="main">
            <img alt="cover" src="images/cod.gif" width="1050" height="400">
            <br><br>
            <marquee> <m style="font-family: arial; font-size: 20px; color:whitesmoke">AYO SEGERA SEWA MOBIL KAMI UNTUK KEPERLUAN ANDA !!! LEBIH MURAH, LEBIH PRAKTIS,DAN PELAYANAN YANG LEBIH BAIK....</m></marquee>
            <br>
            
            <div id="menuhor"style="position:absolute;right:7px;left:173px;top:370px;">
                 <a href="home.html"><m style="color:whitesmoke;font-family:Tahoma;font-size:27px">  HOME </a></m>
                 <a href="garasimobil.jsp"><m style="color:whitesmoke;font-family:Tahoma;font-size:27px">| GARASI MOBIL </a></m>
                 <a href="form.jsp"><m style="color:whitesmoke;font-family:Tahoma;font-size:27px">| SEWA MOBIL</a></m> 
                 <a href="kembali.jsp"><m style="color:whitesmoke;font-family:Tahoma;font-size:27px">|KEMBALI MOBIL</a></m>
                 <a href="tentangkami.jsp"><m style="color:whitesmoke;font-family:Tahoma;font-size:27px">| KONTAK KAMI</a></m>
            </div><br> <br></div> 
                <tr>
                    <td></td>  <td></td>   <td></td>
                     <td>  <center><h3 style="color:whitesmoke;font-family:Tahoma;font-size: 130%;outline-color: black;">ARMADA ROUTER RENT CAR YANG SIAP ANDA SEWA<br>
                    <br><br></h3>
 <center><h3 style="color:whitesmoke;font-family:Tahoma;font-size: 130%;outline-color: black;">STATUS MOBIL ROUTER RENTCAR </h3></center>
                                  
 <%
 try{
           String query2="select mobil, harga, pemilik, (status-tersewa) as jumlah from statusmobil";
            java.sql.Statement statement = conn.getConnection().createStatement();
            java.sql.ResultSet result2 = statement.executeQuery(query2);
    %>
    <br>
    <CENTER>
    <table style="font-family: Arial; font-size: 14px;border-color: black "width="1000" border="">
        <tr>
            
            <th align="center"><font color="white">Mobil</font></th>
            <th align="center"><font color="white">Harga</font></th>
            <th align="center"><font color="white">Pemilik</font></th>
            <th align="center"><font color="white">Status Mobil</font></th>
        </tr>
    <%
            while (result2.next()){
                if(listMobil==null){
                    listMobil = new LinkedList();
               }
                String mobil = result2.getString("mobil");
                listMobil.add(mobil);
    %>
    <tr style="font-family: Arial; font-size: 14px;color: lightcyan">
        
        <td align="center"><% out.println(mobil); %></td>
        <td align="center"><% out.println(result2.getString("harga")); %></td>
        <td align="center"><% out.println(result2.getString("pemilik")); %></td>
        <td align="center"><% out.println(result2.getInt("jumlah")); %></td>
        
        </tr>
      <%
            }
            statement.close();
        } catch(Exception ex){
            out.println("message: "+ex.getMessage());
        }
      %>
       
     
    </table>
    </Center>
                       <table <p style="color: white;font-size: 16px">
                          
                                <tr> <h2 style="color: white;font-size: 20px"><blink> Silahkan Mengisi Formulir dibawah ini</blink></h2></tr> 
                     
                                <tr>
                                    <td style="color: white;font-size: 20px"> Nama Lengkap                      :</td>
                                    <td>
                                        <input type="text" name="nama" size="40">* </td>
                                </tr>
                                <tr>
                                    <td style="color: white;font-size: 20px"> Tempat,Tanggal Lahir                     :</p></td>
                                    <td>
                                        <input type="text" name="ttl" size="40">* </td>
                                </tr>
                                <tr>
                                    <td style="color: white;font-size: 20px"> Alamat                    :</p></td>
                                    <td>
                                        <input type="text" name="alamat" size="40">* </td>
                                </tr>
                                <tr>
                                    <td style="color: white;font-size: 20px"> Nomor Telepon               :</p></td>
                                    <td>
                                        <input type="text" name="notlp" size="40">* </td>
                                </tr>
                                <tr>
                                    <td style="color: white;font-size: 20px"> Nomer Identitas(E-KTP)     :</td>
                                    <td>
                                        <input type="text" name="noktp"size="40">* </td>
                                </tr>
                                <tr>
                                    <td style="color: white;font-size: 20px"> Nomer SIM (mobil)     :</td>
                                    <td>
                                        <input type="text" name="nosim"size="40">* </td>
                                
                                                       
                       
                               
                                                <tr>   <td><p style="color: white;font-size: 20px">Tanggal Sewa (dd-mm-yyyy):&nbsp;&nbsp;&nbsp;&nbsp;</p></td>
                                                       <td><input type="text"  name="tglsewa" size = "8">*</td>

                                                </tr>
                                                <tr>   <td><p style="color: white;font-size: 20px">Tanggal Kembali (dd-mm-yyyy):&nbsp;&nbsp;&nbsp;&nbsp;</p></td>
                                                       <td><input type="text"  name="tglkembali" size = "8">*</td>

                                                </tr>
                                                </tr>
                                  <tr>
                                    <td style="color: white;font-size: 20px"> Mobil                     :</td>
                                  <td><select name="mobil">
                                                <%
                                                while(!listMobil.isEmpty()){
                                                    String mobil = String.valueOf(listMobil.remove());
                                                    out.print("<option value='"+mobil+"'>"+mobil+"</option>");
                                                }
%>
                                          </select>

                                        <!--input type="text" name="mobil" size="40"-->
                                        * </td>
                                </tr>
                                      <tr>
                                                    <td colspan=2>
                                                        <input type="submit" value="SEWA">
                                                    </td>
                                                </tr>
                                                </form>
                                                <tr><td>   <p style="color: white;font-size: 16px">* ISI SEMUA FORMULIR INI DENGAN LENGKAP</p></td>
                                                    <td>&nbsp;</td></tr></p></table>

                                                <br><br><br><br>
                                                <br><center><img src="images/iklan2.gif"
         width="935" height="150"
         ></center><br><br><br></td></tr>
                                                </form>
</body>

                                                </html>
